<!--
 * @Author: your name
 * @Date: 2022-01-20 15:56:01
 * @LastEditTime: 2022-01-21 10:59:54
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \ctp-static-portal-front\src\components\notices\index.vue
-->
<template>
  <div id="notices" :type="type">
    <List
      v-if="type === 'list'"
      :list="sectionData.data.rows"
      :options="sectionData.options"
    />
    <Roll
      v-if="type === 'roll' && roll == 'one'"
      :roll="roll"
      :notices="sectionData.data"
      :options="sectionData.options"
    />
    <Roll
      v-if="type === 'roll' && roll == 'two'"
      :roll="roll"
      :notices="sectionData.data"
      :options="sectionData.options"
    />
    <TitleAbstract
      v-if="type === 'abstract'"
      :notices="sectionData.data"
      :options="sectionData.options"
    />
  </div>
</template>

<script>
import List from "../news/components/list.vue";
import Roll from "../notices/components/roll.vue";
import TitleAbstract from "../notices/components/title-abstract.vue";

export default {
  name: "Notices",
  components: {
    List,
    Roll,
    TitleAbstract,
  },
  props: {
    sectionData: {},
  },
  computed: {
    type() {
      let dict = {
        multiRowThreeColumnTemplete: "list",
        pictureTitleAndBriefTemplete: "abstract",
        singleScrollTempleteNormal: "roll",
        singleScrollTemplete: "roll",
      };
      return dict[this.sectionData.data.resolveFunction];
    },
    roll() {
      let dict = {
        singleScrollTempleteNormal: "one",
        singleScrollTemplete: "two",
      };
      return dict[this.sectionData.data.resolveFunction];
    },
  },
};
</script>

<style lang="scss" scoped>
* {
  padding: 0px;
  margin: 0px;
  box-sizing: border-box;
  list-style: none;
  text-decoration: none;
}

#notices {
  width: 100%;
  // height: 100%;
}
</style>